package com.eastfair.pay.service;

import com.eastfair.boot.service.SuperService;
import com.eastfair.pay.dto.CollectDTO;
import com.eastfair.pay.dto.OrdinaryCollectDTO;
import com.eastfair.pay.vo.CollectPageDetailVO;
import com.eastfair.pay.dto.UnCollectDTO;
import com.eastfair.pay.entity.CollectRecord;
import com.eastfair.pay.vo.CollectRecordVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 业务接口
 * 认款记录
 * </p>
 *
 * @author clm
 * @date 2022-06-08
 */
public interface CollectRecordService extends SuperService<CollectRecord> {

    List<CollectRecord> queryByPaymentRecordId(Long paymentRecordId);

    List<CollectRecord> queryCollectRecordList(Long contractId);

    /**
     * 认领
     *
     * @param collectDTO
     */
    void collect(CollectDTO collectDTO);

    /**
     * 获取付款计划的认领记录
     *
     * @param paymentPlanId
     * @return
     */
    List<CollectRecordVO> queryCollectByPlanId(Long paymentPlanId);

    /**
     * 获取付款记录的认领记录
     *
     * @param recordId
     * @return
     */
    List<CollectRecordVO> queryCollectByRecordId(Long recordId);

    public CollectRecord getRecordByOrderNum(String orderNum);

    /**
     * 查询订单下的认款记录
     *
     * @param orderNum
     * @return java.util.List<com.eastfair.pay.entity.CollectRecord>
     */
    List<CollectRecord> getRecordListByOrderNum(String orderNum);

    /**
     * 取消认领(合同)
     *
     * @param unCollectDTO
     */
    void unCollect(UnCollectDTO unCollectDTO);

    /**
     * 取消认领(通用)
     *
     * @param unCollectDTO
     */
    void commonUncollect(UnCollectDTO unCollectDTO);

    /**
     * 通过合同获取认领页面详情
     *
     * @param contractId
     * @return
     */
    CollectPageDetailVO getCollectPageDetail(Long contractId);

    void ordinaryCollect(OrdinaryCollectDTO collectDTO);

    List<CollectRecordVO> queryCollectRecordByOrderNum(String orderNum);

    /**
     * 计算订单认款总金额
     *
     * @param orderNum
     * @return
     */
    BigDecimal calSumAmountByOrderNum(String orderNum);
}
